package myky.com.doctorapp.utils;

import android.content.Context;
import android.view.Gravity;
import android.widget.Toast;

import com.dovar.dtoast.DToast;

import myky.com.doctorapp.base.CMApplication;

/**
 *
 * @author Mr.li
 * @date 2018/8/1
 */

public class ToastUtils {


    public static void show(String msg) {
        Context mContext = CMApplication.get();
        Toast toast = Toast.makeText(mContext, msg, Toast.LENGTH_SHORT);
        toast.setGravity(Gravity.BOTTOM, 0, 30);
        toast.show();


    }


    public static void showAtCenter(String msg) {
        Context mContext = CMApplication.get();
        Toast toast = Toast.makeText(mContext, msg, Toast.LENGTH_SHORT);
        toast.setGravity(Gravity.CENTER, 0, 30);
        toast.show();


    }

    /**
     * 退出APP时调用
     */
    public static void cancelAll() {
        DToast.cancel();
    }

}
